package com.cn.wanxi.IO;

import com.cn.wanxi.model.NavModel;

import java.io.*;
import java.util.Arrays;

public class NavIO {
    public void writeNote(String path, String split) {
        File file = new File(path);
//        if(!file.exists()){
//            file.mkdirs();
//        }
        try {
            file.createNewFile();
            OutputStream outputStream = new FileOutputStream(file);
            NavModel navModel = new NavModel();
//            String hrefs[] = navModel.getHrefs();
            String titles[] = navModel.getTitles();
//            String hh = Arrays.toString(hrefs);
            String tt = Arrays.toString(titles);

//            outputStream.write(hh.getBytes());
            outputStream.write(Arrays.toString(navModel.getHrefs()).getBytes());
            outputStream.write(split.getBytes());
            outputStream.write(tt.getBytes());
        } catch (IOException e) {
            e.printStackTrace();
        }

    }


}
